{$CLEO .cs}
:Throw_Object_FireBall
03A4: name_thread 'FIREBAL'

:throwObj_FireBall_1
0001: wait  0 ms
00D6: if 0
0256: player $PLAYER_CHAR defined
004D: jump_if_false @throwObj_FireBall_1
if
0AB0:   key_pressed 1//-----------------------------press left mouse button  
004D: jump_if_false @throwObj_FireBall_1
0247: request_model 3065

:throwObj_FireBall_3
0001: wait  0 ms
if
0248:   model 3065	 available
004D: jump_if_false @throwObj_FireBall_3
04C4: create_coordinate 11@ 12@ 13@ from_actor $PLAYER_ACTOR offset  0.0 5.0  0.0
0107: 2@ = create_object 3065	 at  11@ 12@ 13@
0750: set_object 2@ visibility 1 
04D9: object 2@ set_scripted_collision_check 1 
0382: set_object 2@ collision_detection 1 
0906: set_object 2@ mass_to 30000.0 // float 
0908: set_object 2@ turn_mass_to 30000.0 // float
0007: 10@ = 30.1
0007: 14@ = 20.1
0172: 19@ = actor $PLAYER_ACTOR Z_angle
0819: 18@ = actor $PLAYER_ACTOR distance_from_ground
005B: 18@ += 14@ // (float) 
02F6: 15@ = sine 19@ // (float) 
02F7: 16@ = cosine 19@ // (float) 
006B: 15@ *= 10@ // (float) 
006B: 16@ *= 10@ // (float) 
0013: 15@ *= -1.0 
 
0392: make_object 2@ moveable 1 
0381: throw_object 2@ velocity_in_direction 15@ 16@ 18@
wait 0
01BC: put_object 2@ at 11@ 12@ 13@
33@ = 0
0013: 15@ *= -1.0
0013: 16@ *= -1.0
0007: 24@ = -100.0

:throwObj_FireBall_5
0001: wait  0 ms
00D6: if 0
0256: player $PLAYER_CHAR defined
004D: jump_if_false @throwObj_FireBall_13
0400: store_coords_to 21@ 22@ 23@ from_object 2@ with_offset 0.0 0.0 0.0
0087: 25@ = 23@ // (float)
if
0025:   23@ > 24@ // (float)
004D: jump_if_false @throwObj_FireBall_6
0087: 24@ = 23@ // (float)
02CE: 17@ = ground_z_at 21@ 22@ 23@ 
0063: 23@ -= 17@ // (float) 
23@ -= 10.1

:throwObj_FireBall_6
066E: create_particle "fireball" attached_to_object 2@ with_offset 0.0 0.0 0.3 rotation 15@ 16@ 23@ flag 1 handle_as 27@ 
064F: make_Particle_visible_and_remove_references 27@
00D6: if or
04DA:   has_object 2@ collided 
8474:   not actor $PLAYER_ACTOR near_object_in_cube 2@ radius 200.0 200.0 100.0 flag 0 
0019:   33@ > 3000 
004D: jump_if_false @throwObj_FireBall_5

0400: store_coords_to 11@ 12@ 13@ from_object 2@ with_offset 0.0 0.0 0.0
020C: create_explosion_with_radius 3 at 11@ 12@ 13@
0565: create_temporary_explosion_fire 11@ 12@ 13@  3

:throwObj_FireBall_13
Object.Destroy(2@)
0249: release_model 3065
0002: jump @throwObj_FireBall_1

